package cate.game.event.spicefb;

import cate.common.table.d.GDGuild;
import cate.game.chat.ChatContentParam;
import cate.game.event.GameEventListener;
import cate.game.role.Role;
import cate.game.role.res.guild.po.GuildLogDetailPO;

public class SpiceFbChapterUnLockedEventListener implements GameEventListener<SpiceFbChapterUnLockedEvent> {
    @Override
    public void onEvent(SpiceFbChapterUnLockedEvent gameEvent) {
        Role role = gameEvent.getRole();

        if (role.getRes().guild.checkGuild().ok()) {
            role.getRes().guild.getGuild().record.addRecord(
                    new GuildLogDetailPO(GDGuild.log.SPICEFB_CHAPTER_UNLOCKED,
                            ChatContentParam.c(role.getBase().name),
                            ChatContentParam.c(ChatContentParam.TYPE_STRING,
                                    gameEvent.getResp().chapterOpen - 1)));
        }
    }
}
